package com.pig4cloud.pigx.contract.api.feign;

import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.contract.dto.ContractRobotPlaceOrderDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * 合约模块-订单feign接口
 *
 * @date 2022/8/28 16:47
 */
@FeignClient(contextId = "contractOrderFeign",
		value = ServiceNameConstants.CONTRACT_SERVICE,
		path = "/feign/order")
public interface ContractOrderFeign {

	/**
	 * 新增多条订单-kLine机器人
	 */
	String ADD_MULTI_ROBOT_K_LINE = "/add/multi/robot/k_line";

	/**
	 * 新增多条订单-kLine机器人
	 *
	 * @param dtoList dtoList
	 * @param from    标注内部调用
	 * @return {@link R}
	 * @date 2022/8/28 16:52
	 */
	@PostMapping(ADD_MULTI_ROBOT_K_LINE)
	R addMultiRobotKLine(@RequestBody List<ContractRobotPlaceOrderDTO> dtoList, @RequestHeader(SecurityConstants.FROM) String from);
}
